package router

import (
	"gin-app/handler"
	"gin-app/middleware"
	"github.com/gin-gonic/gin"
)

func SetupRouter() *gin.Engine {
	r := gin.Default()
	r.Use(middleware.LoggerMiddleware())
	api := r.Group("/api")
	{
		api.GET("/ping", handler.Ping)
		api.POST("/login", handler.Login)
		api.GET("/secure", middleware.JwtMiddleware(), handler.SecureDate)
	}
	return r
}
